<template>
  <el-card class="box-card" style="overflow:auto">
    <el-button v-on:click="back()">返回</el-button>
    <el-divider content-position="left" class="detail_title">用户LRS信息</el-divider>
    <el-card class="box-card">
      <b style="margin-left: 2%">昵称&#8197 ：</b><a> {{ agent.agentName }}</a>
      <b style="margin-left: 20%">邮箱&#8197 ：</b><a> {{ agent.agentEmail }}</a>
    </el-card>

    <el-divider content-position="left" class="detail_title">用户App信息</el-divider>
    <el-card class="box-card">
      <b style="margin-left: 2%">用户昵称&#8197 ：</b><a> {{ account.accountName }}</a>
      <b style="margin-left: 20%">用户主页&#8197 ：</b>
      <a v-if="account.accountHomepage!=null"> {{ account.accountHomepage }}</a>
      <a v-else>他暂未公开他的首页</a>
    </el-card>
  </el-card>
</template>
<script>
  export default {
    mounted: function () {
      this.getAgent()
    },
    data() {
      return {
        account: {},
        agent: {},
        user: JSON.parse(localStorage.getItem("agent")),
        isRoot: 0,
      }
    },
    methods: {
      getAgent() {
        let that = this
        if (that.user.agentTypeId === 0) {
          this.isRoot = 1
        }
        let url = "/api/account/agent/find/"
        this.$axios.get(url, {params: {accountOpenid: this.$route.query.id}}).then(successResponse => {
          that.account = successResponse.data.account
          that.agent = successResponse.data.agent
        }).catch(failResponse => {
        })
      },
      back(){
        this.$router.go(-1);
      }
    }

  }

</script>
<style>
  .box-card {
    width: 100%;
    height: 100%;
    text-align: left;
  }

  .detail_title {
    margin-top: 2%;
  }

</style>
